<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_minigame_config', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('微信小游戏-配置表');

            $table->increments('id');
            $table->char('name', 24)->comment('小游戏名称')->default('');
            $table->string('origin_id', 32)->comment('原始id')->default('');
            $table->char('appid', 32)->comment('appid')->default('');
            $table->char('secret', 32)->comment('secret')->default('');
            $table->char('token', 32)->comment('token')->default('');
            $table->string('ad_query', 64)->comment('买量路径参数')->default('');

            $table->index('origin_id');
            $table->index('appid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_minigame_config');
    }
};
